Get Google Shopping Sellers Ad URL
Google Shopping Sellers Ad URL is designed to provide you with a full URL of the advertisement containing all additional parameters set by the seller.
Google Shopping Sellers Ad URL is designed to provide you with a full URL of the advertisement containing all additional parameters set by the seller.
Instead of ‘login’ and ‘password’ use your credentials from https://app.dataforseo.com/api-dashboard
<?php // You can download this file from here https://cdn.dataforseo.com/v3/examples/php/php_RestClient.zip require('RestClient.php'); $api_url = 'https://api.dataforseo.com/'; // Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-dashboard $client = new RestClient($api_url, null, 'login', 'password'); try { // get ad_url by the ad_aclk // GET /v3/merchant/google/sellers/ad_url/$ad_aclk // use the ad_aclk that you received upon a sellers task $ad_aclk = "DChcSEwj2qKzGv_rrAhWXIK0GHbB0BQEYABAHGgJwdg"; $result = $client->get('/v3/merchant/google/sellers/ad_url/' . $ad_aclk); print_r($result); // do something with result } catch (RestClientException $e) { echo "\n"; print "HTTP code: {$e->getHttpCode()}\n"; print "Error code: {$e->getCode()}\n"; print "Message: {$e->getMessage()}\n"; print $e->getTraceAsString(); echo "\n"; } $client = null; ?>
The above command returns JSON structured like this:
{ "version": "0.1.20200923", "status_code": 20000, "status_message": "Ok.", "time": "0.6697 sec.", "cost": 1.0e-6, "tasks_count": 1, "tasks_error": 0, "tasks": [ { "id": "09251613-1535-0187-0000-3470d7a062a8", "status_code": 20000, "status_message": "Ok.", "time": "0.5904 sec.", "cost": 1.0e-6, "result_count": 1, "path": [ "v3", "merchant", "google", "sellers", "ad_url", "DChcSEwj2qKzGv_rrAhWXIK0GHbB0BQEYABAHGgJwdg" ], "data": { "se_type": "shops_list", "api": "merchant", "function": "sellers", "se": "google", "ad_aclk": "DChcSEwj2qKzGv_rrAhWXIK0GHbB0BQEYABAHGgJwdg" }, "result": [ { "ad_aclk": "DChcSEwj2qKzGv_rrAhWXIK0GHbB0BQEYABAHGgJwdg", "ad_url": "https:\/\/www.bikeinn.com\/cykel\/pedros-l-hex-set\/136593131\/p?utm_source=google_products&utm_medium=merchant&id_producte=5691630&country=dk&gclid=CJn0gqyxhOwCFQ5FGwodu_EHVw", "ad_url_redirects": [ "http:\/\/clickserve.dartsearch.net\/link\/click?&ds_a_cid=96438518&ds_a_caid=10278814955&ds_a_agid=105173749329&ds_a_fiid=&ds_a_lid=pla-313383086779&&ds_e_adid=441825586499&ds_e_matchtype=&ds_e_device=c&ds_e_network=u&ds_e_product_group_id=313383086779&ds_e_product_id=DK-5691630&ds_e_product_merchant_id=6207387&ds_e_product_country=DK&ds_e_product_language=da&ds_e_product_channel=online&ds_e_product_store_id=&ds_url_v=2&ds_dest_url=https:\/\/www.bikeinn.com\/cykel\/pedros-l-hex-set\/136593131\/p?utm_source=google_products&utm_medium=merchant&id_producte=5691630&country=dk&gclsrc=aw.ds&", "https:\/\/clickserve.dartsearch.net\/link\/click?&ds_a_cid=96438518&ds_a_caid=10278814955&ds_a_agid=105173749329&ds_a_fiid=&ds_a_lid=pla-313383086779&&ds_e_adid=441825586499&ds_e_matchtype=&ds_e_device=c&ds_e_network=u&ds_e_product_group_id=313383086779&ds_e_product_id=DK-5691630&ds_e_product_merchant_id=6207387&ds_e_product_country=DK&ds_e_product_language=da&ds_e_product_channel=online&ds_e_product_store_id=&ds_url_v=2&ds_dest_url=https:\/\/www.bikeinn.com\/cykel\/pedros-l-hex-set\/136593131\/p?utm_source=google_products&utm_medium=merchant&id_producte=5691630&country=dk&gclsrc=aw.ds&", "https:\/\/ad.doubleclick.net\/ddm\/clk\/282151716;108941074;c;u=ds&sv1=0&sv2=3202079229310002&sv3=3135623395883721351&gclid=CJn0gqyxhOwCFQ5FGwodu_EHVw;%3fhttps:\/\/www.bikeinn.com\/cykel\/pedros-l-hex-set\/136593131\/p?utm_source=google_products&utm_medium=merchant&id_producte=5691630&country=dk" ] } ] } ] }
Description of the fields for sending a request:
Field name | Type | Description |
---|---|---|
shop_ad_aclk |
string | unique ad click referral parameter you can obtain this parameter with Google Shopping Products or Google Shopping Sellers |
As a response of the API server, you will receive JSON-encoded data containing a tasks
array with the information specific to the set tasks.
Description of the fields in the results array:
Field name | Type | Description |
---|---|---|
version |
string | the current version of the API |
status_code |
integer | general status code you can find the full list of the response codes here Note: we strongly recommend designing a necessary system for handling related exceptional or error conditions |
status_message |
string | general informational message you can find the full list of general informational messages here |
time |
string | execution time, seconds |
cost |
float | total tasks cost, USD |
tasks_count |
integer | the number of tasks in the tasks array |
tasks_error |
integer | the number of tasks in the tasks array that were returned an error |
tasks |
array | array of tasks |
id |
string | task identifier unique task identifier in our system in the UUID format |
status_code |
integer | status code of the task generated by DataForSEO; can be within the following range: 10000-60000 you can find the full list of the response codes here |
status_message |
string | informational message of the task you can find the full list of general informational messages here |
time |
string | execution time, seconds |
cost |
float | cost of the task, USD |
result_count |
integer | number of elements in the result array |
path |
array | URL path of the GET request |
data |
object | contains the same parameters that you specified in the POST request |
result |
array | array of results |
ad_aclk |
string | unique ad click referral parameter |
ad_url |
string | full URL of the advertisement |
ad_url_redirects |
array | URLs where the link from Google Shopping redirects before reaching a final URL includes up to 10 URLs of the ad’s redirect path to the seller’s ad_url |